package cn.dt70.services.impl;

import cn.dt70.dao.appCategory.AppCategoryMapper;
import cn.dt70.pojo.AppCategory;
import cn.dt70.services.AppCategoryService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service("appCategoryService")
public class AppCategoryServiceImpl implements AppCategoryService {
    private static final Logger looger = Logger.getLogger( AppCategoryServiceImpl.class );
    @Resource
    private AppCategoryMapper appCategoryMapper;
    @Override
    public List<AppCategory> qryAppCategory1() {
        List<AppCategory> appCategory1List = new ArrayList<>();
        try {
            appCategory1List =appCategoryMapper.qryAppCategory1();
        } catch (Exception e) {
            looger.error( "AppCategoryServiceImpl.qryAppCategory1异常"+e.getMessage() );
        }
        return appCategory1List;
    }
//二级分类
    @Override
    public List<AppCategory> qryAppCategory2(Integer parentId) {
        List<AppCategory> appCategory2List = new ArrayList<>();
        try {
            appCategory2List =appCategoryMapper.qryAppCategory2(parentId);
        } catch (Exception e) {
            looger.error( "AppCategoryServiceImpl.qryAppCategory2异常"+e.getMessage() );
        }
        return appCategory2List;
    }
//三级分类
    @Override
    public List<AppCategory> qryAppCategory3(Integer parentId) {
        List<AppCategory> appCategory3List = new ArrayList<>();
        try {
            appCategory3List =appCategoryMapper.qryAppCategory3(parentId);
        } catch (Exception e) {
            looger.error( "AppCategoryServiceImpl.qryAppCategory3异常"+e.getMessage() );
        }
        return appCategory3List;
    }

}
